//
//  MainThreeCollectionViewCell.m
//  KaKaWallet
//
//  Created by admin on 2016/10/26.
//  Copyright © 2016年 ibendi. All rights reserved.
//

#import "MainThreeCollectionViewCell.h"

@implementation MainThreeCollectionViewCell


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.kkImgView = [UIImageView new];
        [self.contentView addSubview:self.kkImgView];
        
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        self.kkTitle = [UILabel new];
        self.kkTitle.font = [UIFont systemFontOfSize:18];
        self.kkTitle.textColor = UIColorHex(0x333333);
        [self.contentView addSubview:self.kkTitle];
        
        self.kkSubTitle = [UILabel new];
        self.kkSubTitle.font = [UIFont systemFontOfSize:14];
        self.kkSubTitle.textColor = UIColorHex(0x666666);
        [self.contentView addSubview:self.kkSubTitle];
        self.kkSubTitle.numberOfLines = 2;
        
        
        self.kkImgView.backgroundColor = [UIColor yellowColor];
        self.kkTitle.text = @"gdagaldkglkadgdasgsdal";
        self.kkSubTitle.text = @"gdagaldkglkadgdasgsdalgdagaldkglkadgdasgsdalgdagaldkglkadgdasgsdalgdagaldkglkadgdasgsdalgdagaldkglkadgdasgsdalgdagaldkglkadgdasgsdal";

    }
    return  self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    [self.kkImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.and.left.mas_equalTo(self.contentView).offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
        make.height.mas_equalTo(@180);
    }];
    
    [self.kkTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.kkImgView.mas_bottom).offset(5);
        make.left.mas_equalTo(self.contentView.mas_left).offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
        make.height.mas_equalTo(@25);
    }];
    
    [self.kkSubTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.kkTitle.mas_bottom).offset(0);
        make.left.mas_equalTo(self.contentView.mas_left).offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-10);

    }];
}

@end

